<template>
  <swiper ref="mySwiper" :options="swiperOptions">
    <swiper-slide v-for="(item, index) in imgs" :key="index">
      <img class="sw-img" :src="item.pictureUrl" alt />
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>
<script>

export default {
  name: "lunbo",
  props:{
    imgs:Array 
  },
  components: {},
  data() {
    return {
      imgUrl: require("../../assets/img/a.jpg"),
      swiperOptions: {
        pagination: {
          el: ".swiper-pagination",
          clickable: true
        },
        autoplay: {
          delay: 3000,
          disableOnInteraction: false // 手动切换之后继续自动轮播
        },
        loop: true
        // Some Swiper option/callback...
      }
    };
  },
  created() {
    this.onLoad();
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper;
    }
  },
  mounted() {
    // lunboImgsUrl();
    // console.log("Current Swiper instance object", this.swiper);
    this.swiper.slideTo(3, 1000, false);
  },
  methods: {
    onLoad() {
  
      this.$emit('reloadData')
    }
  }
};
</script>
<style scoped>
/* @import "swiper/css/swiper.css"; */
.sw-img {
  width: 100%;
  height: 160px;
}
</style>